Solution of differential equations by using integrating factors